home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_400
/
417_02
/
unzip.tz
/
unzip
/
unz50p1
/
Makefile
< prev
next >
Wrap
Makefile
|
1993-01-10
|
23KB
|
621 lines
#==============================================================================
# Makefile for UnZip, ZipInfo & FUnZip: Unix, OS/2, MS-DOS ("real" makes only)
# Version: 5.0 (inflate,explode) 20 August 1992
#==============================================================================
#
#
# INSTRUCTIONS (such as they are):
#
# "make vax" -- makes UnZip on a VAX 11-780 BSD 4.3 in current directory
# (or a SysV VAX, or an 8600 running Ultrix, or...)
# "make" -- uses environment variable SYSTEM to set the type
# system to compile for. This doesn't work for some
# particularly brain-damaged versions of make (VAX BSD,
# Gould, and SCO Unix are in this group). If SYSTEM not
# set, gives instructions on what to try instead.
# "make list" -- lists all supported systems (targets), including related
# utilities' targets
# "make wombat" -- Chokes and dies if you haven't added the specifics
# for your Wombat 68000 (or whatever) to the systems list.
#
# CF are flags for the C compiler. LF are flags for the loader. LF2 are
# more flags for the loader, if they need to be at the end of the line
# instead of at the beginning (for example, some libraries). LOCAL_UNZIP
# is an environment variable that can be used to add default C flags to
# your compile without editing the Makefile (e.g., -DDEBUG_STRUC, or -FPi87
# on PCs).
#
# My host (a VAX 11-780 running BSD 4.3) is hereafter referred to as "my host."
#
# My host's /usr/include/sys/param.h defines BSD for me. You may have to add
# "-DBSD" to the list of CF for your system.
#
# Some versions of make do not define the macro "$(MAKE)" (my host did not).
# The makefile should now handle such systems correctly, more or less; the
# possible exception to this is if you've used a make command-line option
# (for example, the one which displays the commands which WOULD be executed,
# but doesn't actually execute them). It probably needs some more tinkering.
# If things still don't work, use "make" instead of "$(MAKE)" in your system's
# makerule. Or try adding the following line to your .login file:
# setenv MAKE "make"
# (It didn't help on my host.)
#
# Memcpy and memset are provided for those systems that don't have them;
# they're found in misc.c and will be used if -DZMEM is included in the list
# of CF. These days *almost* all systems have them (they're mandated by
# ANSI), but older systems might be lacking. And at least one machine's
# version results in some serious performance degradation...
#
# Be sure to test your nice new UnZip; successful compilation does not always
# imply a working program.
#####################
# MACRO DEFINITIONS #
#####################
# Defaults most systems use (use LOCAL_UNZIP in environment to add flags,
# such as -DNOMEMCPY).
CRYPTF =
CRYPTO =
# Uncomment next two lines for decryption version:
#CRYPTF = -DCRYPT
#CRYPTO = crypt$O
# UnZip flags
CC = cc# try using "gcc" target rather than changing this (if you do,
LD = cc# you MUST change LD, too--else "unresolved symbol: ___main")
LOC = $(LOCAL_UNZIP) $(CRYPTF)
CF = -O $(LOC)
LF = -o unzip
LF2 = -s
# ZipInfo flags
ZC = -DZIPINFO
ZL = -o zipinfo
ZL2 = -s
# FUnZip flags
FC = # not used
FL = -o funzip
FL2 = -s
# general-purpose stuff
LN = rm -f misc_.c; ln
RM = rm -f
E =
O = .o
SHELL = /bin/sh
INSTALL = cp# probably can change this to 'install' if you have it
BINDIR = /usr/local/bin# target directory - where to install executables
# object files
OBJS1 = unzip$O $(CRYPTO) envargs$O explode$O extract$O file_io$O inflate$O
OBJS2 = mapname$O match$O misc$O unreduce$O unshrink$O
OBJS = $(OBJS1) $(OBJS2)
LOBJS = $(OBJS)
OS2_OBJS = $(OBJS:.o=.obj) os2unzip.obj
OBJZ = zipinfo$O envargs$O match$O misc_$O
OS2_OBJZ = $(OBJZ:.o=.obj) os2zinfo.obj
OBJF = funzip$O $(CRYPTO) inflate$O
OS2_OBJF = # not yet supported
UNZIPS = unzip$E # zipinfo$E funzip$E # zipinfo, funzip not fully supported
# # yet (next release)
# list of supported systems/targets in this version
SYSTEMS1 = 386i 3Bx 7300 amdahl apollo aviion bsd bull c120 c210 coherent
SYSTEMS2 = convex cray cray_cc cray_v3 cyber_sgi dec dnix encore eta
SYSTEMS3 = gcc gcc_dos generic generic2 gould hk68 hp indigo linux
SYSTEMS4 = minix mips msc_dos next osf1 p_iris pyramid rs6000 rtaix
SYSTEMS5 = sco sco_dos sco_x286 sequent sgi stellar sun sysv sysv6300
SYSTEMS6 = tahoe ultrix vax wombat xos
SYS_UTIL1 = zi_dos zi_gcc zi_indigo zipinfo fu_gcc funzip
# SYS_UTIL2 = ship ship_dos ship_sysv
####################
# DEFAULT HANDLING #
####################
# The below will try to use your shell variable "SYSTEM" as the type system
# to use (e.g., if you type "make" with no parameters at the command line).
# The test for $(MAKE) is necessary for VAX BSD make (and Gould, apparently),
# as is the "goober" (else stupid makes see an "else ;" statement, which they
# don't like). "goober" must then be made into a valid target for machines
# which DO define MAKE properly (and have SYSTEM set). Quel kludge, non?
# And to top it all off, it appears that the VAX, at least, can't pick SYSTEM
# out of the environment either (which, I suppose, should not be surprising).
# [Btw, if the empty "goober" target causes someone else's make to barf, just
# add an "@echo > /dev/null" command (or whatever). Works OK on the Amdahl
# and Crays, though.]
default:
@if test -z "$(MAKE)"; then\
if test -z "$(SYSTEM)";\
then make help;\
else make $(SYSTEM) MAKE="make";\
fi;\
else\
if test -z "$(SYSTEM)";\
then $(MAKE) help;\
else $(MAKE) $(SYSTEM) goober;\
fi;\
fi
goober:
help:
@echo
@echo\
" If you're not sure about the characteristics of your system, try typing"
@echo\
' "make generic". If the compiler barfs and says something unpleasant about'
@echo\
' "timezone redefined," try typing "make clean" followed by "make generic2".'
@echo\
' One of these actions should produce a working copy of unzip on most Unix'
@echo\
' systems. If you know a bit more about the machine on which you work, you'
@echo\
' might try "make list" for a list of the specific systems supported herein.'
@echo\
' And as a last resort, feel free to read the numerous comments within the'
@echo\
' Makefile itself. Note that to compile the decryption version of UnZip,'
@echo\
' you must obtain crypt.c separately, in addition to uncommenting two lines'
@echo\
' in Makefile (see the main Contents file for ftp and mail-server sites).'
@echo\
' Have an excruciatingly pleasant day.'
@echo
list:
@echo
@echo\
'Type "make <system>", where <system> is one of the following:'
@echo
@echo " $(SYSTEMS1)"
@echo " $(SYSTEMS2)"
@echo " $(SYSTEMS3)"
@echo " $(SYSTEMS4)"
@echo " $(SYSTEMS5)"
@echo " $(SYSTEMS6)"
@echo
@echo\
'Otherwise set the shell variable SYSTEM to one of these and just type "make".'
@echo\
'Targets for related utilities (ZipInfo) include:'
@echo
@echo " $(SYS_UTIL1)"
# @echo " $(SYS_UTIL2)"
@echo
@echo\
'For further (very useful) information, please read the comments in Makefile.'
@echo
###############################################
# BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
###############################################
.c$O :
$(CC) -c $(CF) $*.c
unzips: $(UNZIPS)
unzip$E: $(OBJS)
$(LD) $(LF) $(LOBJS) $(LF2)
crypt$O: crypt.c unzip.h zip.h # may or may not be in distribution
envargs$O: envargs.c unzip.h
explode$O: explode.c unzip.h
extract$O: extract.c unzip.h
file_io$O: file_io.c unzip.h
funzip$O: funzip.c unzip.h
inflate$O: inflate.c unzip.h
mapname$O: mapname.c unzip.h
match$O: match.c unzip.h
misc$O: misc.c unzip.h
os2unzip$O: os2unzip.c unzip.h # for OS/2 only
os2zinfo$O: os2unzip.c unzip.h # for OS/2 only
unreduce$O: unreduce.c unzip.h
unshrink$O: unshrink.c unzip.h
unzip$O: unzip.c unzip.h
all: generic_msg generic zipinfo
generic_msg:
@echo
@echo\
' Attempting "make generic" and "make zipinfo" now. If this fails for some'
@echo\
' reason, type "make help" and/or "make list" for suggestions.'
@echo
install: $(UNZIPS)
$(INSTALL) $(UNZIPS) $(BINDIR)
clean